package com.dsx.test.interceptor;

import org.apache.shiro.subject.Subject;
import org.apache.shiro.subject.SubjectContext;
import org.apache.shiro.web.mgt.DefaultWebSubjectFactory;

/**
 * <p>Title: NoSessionWebSubjectFactory</p>
 * <p>Description: 阻止 Shiro 创建 Session</p>
 * <p>Company: YunZong</p>
 *
 * @author DJ
 * @date 2019/6/13
 */

public class NoSessionWebSubjectFactory extends DefaultWebSubjectFactory {

    @Override
    public Subject createSubject(SubjectContext context) {
        // No session
        context.setSessionCreationEnabled(false);
        return super.createSubject(context);
    }
}
